// 从 1- 1000个二分查找最后发现  添加15个之后变成字典模式
const v8 = require('v8-natives');
function FastOrDic(obj, str = '') {
    console.log(str, v8.hasFastProperties(obj) ? '开启FastMode' : '开启DicMode');
}
let obj = {
    a: 1,
    b: 2,
    c: 3
};
let obj2 = {
    a: 1,
    b: 2,
    c: 3
};
const count = 15;
const count2 = 16;
for (let i = 0; i < count; i++) {
    obj['x_' + i] = i;
}
for (let i = 0; i < count2; i++) {
    obj2['x_' + i] = i;
}
FastOrDic(obj, `after 添加${count}个属性之后`)

FastOrDic(obj2, `after 添加${count2}个属性之后`)